﻿using Microsoft.SharePoint.Linq;
using ZhukBlogLinqExamples.Model;

namespace ZhukBlogLinqExamples.Repositories
{
    public class CompanyRepository
        : BaseRepository<Company, DataContext>
    {
        /// <summary>
        /// ListName
        /// </summary>
        private const string ListName = "Companies";

        /// <summary>
        /// Create instance for current web in NOT readonly mode
        /// </summary>
        public CompanyRepository()
            : base(ListName) { }
        /// <summary>
        /// Create instance for current web
        /// </summary>
        public CompanyRepository(bool readOnly)
            : base(ListName, readOnly) { }
        /// <summary>
        /// Create instance for specific web in NOT readonly mode
        /// </summary>
        /// <param name="webUrl">web' URL</param>
        public CompanyRepository(string webUrl)
            : base(ListName, webUrl) { }
        /// <summary>
        /// Create instance for specific web
        /// </summary>
        /// <param name="webUrl">web' URL</param>
        /// <param name="readOnly">true - ReadOnly mode, false - NOT ReadOnly mode</param>
        public CompanyRepository(string webUrl, bool readOnly)
            : base(ListName, webUrl, readOnly) { }
        /// <summary>
        /// Create instance for another site collection
        /// </summary>
        /// <param name="webUrl">web' URL</param>
        /// <param name="readOnly">true - ReadOnly mode, false - NOT ReadOnly mode</param>
        /// <param name="crossSite">true - another site collection, false - current site collection</param>
        public CompanyRepository(string webUrl, bool readOnly, bool crossSite)
            : base(ListName, webUrl, readOnly, crossSite) { }
    }
}
